﻿<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="PivotViewerSL.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:local="clr-namespace:PivotViewerSL"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
        <sdk:PivotViewer x:Name="pv4SP2" >
            <sdk:PivotViewer.PivotProperties>
                <sdk:PivotViewerStringProperty Id="FileType" Options="CanFilter" DisplayName="Type de Fichier" Binding="{Binding FileType}" />
                <sdk:PivotViewerStringProperty Id="Title" Options="CanFilter" DisplayName="Titre" Binding="{Binding Title}" />
                <sdk:PivotViewerDateTimeProperty Id="Created" Options="CanFilter" DisplayName="Créé le" Binding="{Binding Created}" />
                <sdk:PivotViewerStringProperty Id="Author" Options="CanFilter" DisplayName="Créé par" Binding="{Binding Author}" />
                <sdk:PivotViewerDateTimeProperty Id="Modified" Options="CanFilter" DisplayName="Modifié le" Binding="{Binding Modified}" />
                <sdk:PivotViewerNumericProperty Id="FileSize" Options="CanFilter" DisplayName="Taille" Binding="{Binding FileSize}" />

            </sdk:PivotViewer.PivotProperties>

            <!--Setting data-->

            <sdk:PivotViewer.ItemTemplates>
                <sdk:PivotViewerItemTemplate MaxWidth="200">
                    <Border Width="200" Height="150" Background="LightGray" >
                        <Grid  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding}">
                            <Image Source="{Binding  IconLittle}"  Stretch="Uniform"   HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        </Grid>
                    </Border>
                </sdk:PivotViewerItemTemplate>

                <sdk:PivotViewerItemTemplate MaxWidth="400">
                    <Border Width="400" Height="300" Background="DarkGray" >
                        <StackPanel  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding}">
                            <TextBlock Text="{Binding Title}" FontSize="20" TextAlignment="Center"/>
                            <Image Source="{Binding  IconMedium}" Stretch="Uniform"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                        </StackPanel>
                    </Border>
                </sdk:PivotViewerItemTemplate>
                <sdk:PivotViewerItemTemplate>
                    <Border Width="640" Height="480" Background="DarkOrange" >
                        <Grid  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Text="{Binding Title}" FontSize="20" Grid.Row="0" TextAlignment="Center"/>
                            <Grid Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width=".5*"/>
                                    <ColumnDefinition Width=".5*"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Orientation="Vertical" Grid.Column="0">
                                    <TextBlock Text="{Binding FileType}"/>
                                    <TextBlock Text="{Binding Author}"/>
                                    <TextBlock Text="{Binding Created}"/>
                                    <TextBlock Text="{Binding Modified}"/>
                                    <TextBlock Text="{Binding FileSize}"/>
                                </StackPanel>
                                <Image Source="{Binding  IconLarge}" Grid.Column="1" Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                            </Grid>
                        </Grid>
                    </Border>
                </sdk:PivotViewerItemTemplate>


            </sdk:PivotViewer.ItemTemplates>
        </sdk:PivotViewer>
    </Grid>
</UserControl>
